/**
 * Created by dev-001 on 2017/2/28.
 * 菜单或应用
 */
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;

const MenuSchema = new Schema({
    name: String,
    code: String,
    status: Boolean,
    createdAt: Date,
    updatedAt: Date
});

MenuSchema.pre('save', function (next) {
    this.createdAt = new Date();
    next();
});

export default mongoose.model('Menu', MenuSchema);